import junit.framework.TestCase;

/**
 * Created by dell on 2017/10/18.
 */
public class CircularArrayQueueTest extends TestCase {
    CircularArrayQueue circularArrayQueue = new CircularArrayQueue();
    public void testDequeue() throws Exception {
        circularArrayQueue.enqueue("cai");
        circularArrayQueue.enqueue("zhang");
        circularArrayQueue.enqueue("wang");
        circularArrayQueue.dequeue();
        assertEquals("zhang",circularArrayQueue.dequeue());

    }

    public void testFirst() throws Exception {
        circularArrayQueue.enqueue("cai");
        circularArrayQueue.enqueue("zhang");
        circularArrayQueue.enqueue("wang");
        circularArrayQueue.first();
        assertEquals("cai",circularArrayQueue.first());
    }

    public void testIsEmpty() throws Exception {
        circularArrayQueue.enqueue("cai");
        circularArrayQueue.enqueue("zhang");
        circularArrayQueue.enqueue("wang");
        circularArrayQueue.isEmpty();
        assertEquals(false,circularArrayQueue.isEmpty());
    }

    public void testSize() throws Exception {
        circularArrayQueue.enqueue("cai");
        circularArrayQueue.enqueue("zhang");
        circularArrayQueue.enqueue("wang");
        circularArrayQueue.size();
        assertEquals(3,circularArrayQueue.size());
    }

    public void testToString() throws Exception {
        circularArrayQueue.enqueue("zhang");
        circularArrayQueue.toString();
        assertEquals("zhang\n",circularArrayQueue.toString());
    }

}